﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace PrintControl
{
    class sDataGridView : DataGridView 
    {
        private bool _datagrideditcontrolhasevents = false;

        public ContextMenuStrip cs = new ContextMenuStrip();

        private void initMenuStrip()
        {
            if (cs.Items.Count == 0)
            {
                ToolStripMenuItem ts = nSaleB();
                {
                    b = new Button();
                    b.Name = "bref";
                    b.Text = "...";
                    b.Font = new System.Drawing.Font("Arial Rounded MT Bold", 9F, System.Drawing.FontStyle.Regular, System.Drawing.GraphicsUnit.Point, ((byte)(0)));
                    b.Size = new System.Drawing.Size(27, 18);
                    b.BackColor = System.Drawing.SystemColors.Control;
                    b.Click += new System.EventHandler(this.btref_Click);
                    this.EditingControl.Controls.Add(b);
                }
                b.Location = new System.Drawing.Point(this.EditingControl.Width - 20, this.EditingControl.Height - 20);

            }
        }

        private void btref_Click(object sender, EventArgs e)
        {
            MessageBox.Show("rows:" + this.CurrentCell.RowIndex.ToString() + Environment.NewLine +
                "columns:" + this.CurrentCell.ColumnIndex.ToString());
        }
    }
}
